Pattern Forms

This page describes all the forms that patterns can take in Cyclone. For each pattern form, you need to know:

There is one compile-time rule that is the same for all forms: All variables (and type variables) in a pattern must be distinct. For example, “let Pair(fst,fst) = pr;” is not allowed.

You may want to read the descriptions for variable and struct patterns first because we have already explained their use informally.